package gov.nih.nlm.lowlinc.owlapi;

import java.util.Comparator;

import org.semanticweb.owlapi.model.OWLAxiom;

public class OWLAxiomComparator implements Comparator<OWLAxiom> {

	@Override
	public int compare(OWLAxiom o1, OWLAxiom o2) {
		// sorty by axiom type
		int result = o1.getAxiomType().toString()
				.compareTo(o2.getAxiomType().toString());
		// if same sort by axiom toString
		if (result == 0) {
			result = o1.toString().compareTo(o2.toString());
		}
		return result;
	}

}
